<template>
  <div>
    <svg :class="'svg-icon',fontSize" :style="`font-size:`+fontSize"  aria-hidden="true">
      <use :xlink:href="iconName"></use>
    </svg>
  </div>
</template>

<script>
export default {
  name: 'icon-svg',
  props: {
    iconClass: {
      type: String,
      required: true
    },
    size:{
      type: String,
      required: false,
      default: '.9'
    }
  },
  computed: {
    iconName() {
      return `#${this.iconClass}`
    },
    fontSize(){
      return parseFloat(`${this.size}`)+'em'
    }
  }
}
</script>

<style scoped>
.svg-icon {
  width: 1em;
  height: 1em;
  /*font-size: 1.2rem;*/
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
  /*font-size: 1em;*/
}
</style>
